package Array;

import java.util.ArrayList;

public class Text {
    public static void main(String[] args) {
        MyArrayList arrayList=new MyArrayList(10);
        for (int i = 5; i>0 ; i--) {
            arrayList.add(i);
        }
        arrayList.display();
        //指定位置插入,下标为三处插入元素0
        arrayList.add(3,0);
        arrayList.display();
        //删除该下标的元素
        arrayList.remove(3);
        arrayList.display();
        System.out.println(arrayList.get(0));
        arrayList.clear();
        arrayList.display();
    }
    public static void main1(String[] args) {
        MyArrayList arrayList=new MyArrayList(10);
        for (int i = 5; i>0 ; i--) {
            arrayList.add(i);
        }
        arrayList.display();
        arrayList.add(3,0);
        arrayList.display();
        arrayList.clear();
        for (int i = 0; i < 15; i++) {
            arrayList.add(i);
        }
        arrayList.display();
        System.out.println(arrayList.contains(15)+" "+arrayList.contains(0));
        System.out.println(arrayList.indexOf(10)+" "+arrayList.indexOf(15));
        arrayList.remove(9);
        arrayList.display();
    }
}
